﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using ZFB.Common;
using ZFB.DTO;

namespace ZFB.IServices
{
    public interface IHouseServices
    {
        /// <summary>
        /// 根据id获取房子
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ApiResult> GetByIdAsync(long id);
        /// <summary>
        /// 获取房源类别下的城市中的房源总数量
        /// </summary>
        /// <param name="cityId"></param>
        /// <param name="typeId"></param>
        /// <returns></returns>
        Task<ApiResult> GetTotalCountAsync(long cityId, long typeId);
        /// <summary>
        /// 分页获取房源类别下的城市中的房源
        /// </summary>
        /// <param name="cityId"></param>
        /// <param name="typeId"></param>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        Task<ApiResult> GetPageDateAsync(long cityId ,long typeId, int page, int limit);
        /// <summary>
        /// 新增房源返回Id
        /// </summary>
        /// <param name="addhouseDTO"></param>
        /// <returns></returns>
        Task<ApiResult> AddNewAsync(AddHouseDTO addhouseDTO);
        /// <summary>
        /// 更新房源，房源附件先删除再新增
        /// </summary>
        /// <param name="editDTO"></param>
        /// <returns></returns>
        Task<ApiResult> UpdateAsync(EditHouseDTO editDTO);
        /// <summary>
        /// 软删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ApiResult> MarkDeleteAsync(long id);
        /// <summary>
        /// 得到房源图片
        /// </summary>
        /// <param name="houseId"></param>
        /// <returns></returns>
        Task<ApiResult> GetPicsAsync(long houseId);
        /// <summary>
        /// 添加房源图片返回id
        /// </summary>
        /// <param name="housePicDTO"></param>
        /// <returns></returns>
        Task<ApiResult> AddPicsAsync(HousePicDTO housePicDTO);
        /// <summary>
        /// 图片软删除
        /// </summary>
        /// <param name="housePicId"></param>
        /// <returns></returns>
        Task<ApiResult> DeletePicAsync(long housePicId);
        /// <summary>
        /// 搜索
        /// </summary>
        /// <param name="houseSearchOptions"></param>
        /// <returns></returns>
        Task<ApiResult> SearchAsync(HouseSearchOptions houseSearchOptions);
        /// <summary>
        /// 获取时间段内的房子总数
        /// </summary>
        /// <param name="cityId"></param>
        /// <param name="startDateTime"></param>
        /// <param name="endDateTime"></param>
        /// <returns></returns>
        Task<ApiResult> GetCountAsync(long cityId, DateTime startDateTime, DateTime endDateTime);
        /// <summary>
        /// 获取房子的配套设施
        /// </summary>
        /// <param name="houseId"></param>
        /// <returns></returns>
        Task<ApiResult> GetAttachmentsAsync(long houseId);
    }
}
